//
//  UITableViewTool.h
//  OnionHome
//
//  Created by fengjie on 2019/9/13.
//  Copyright © 2019 FengJie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/**
 cellForRowAtIndexPath 回调函数
 TempCell 注册的cell
 TempData 传给cell的数据
 */
typedef void(^DataSourceBlock)(id TempCell ,NSIndexPath * indexPath,id TempData);
//选择cell的回调
typedef void(^CellSelectBlock)(id TempCell ,NSIndexPath * indexPath ,id TempData);
//下拉刷新回调
typedef void(^HeaderRefreshBlock)(void);
//上拉加载回调
typedef void(^FootRefreshBlock)(void);


@interface UITableViewTool : NSObject<UITableViewDataSource,UITableViewDelegate>

/**listView*/
@property (nonatomic,strong)UITableView*listView;
/**cell行高*/
@property (nonatomic,assign)CGFloat cellHeight;

/**初始化listView*/
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style registerCellClassName:(NSString *)className identifier:(NSString *)identifier dataArray:(NSMutableArray *)dataArray delegate:(id)delegate dataSourceBlock:(DataSourceBlock)dataSourceBlock selectCell:(CellSelectBlock)selectCell;
/**刷新数据*/
-(void)reloadData:(NSMutableArray *)array;
/**添加下拉刷新*/
-(void)addHeaderTextColor:(UIColor *)textColor RefreshBlock:(HeaderRefreshBlock)block;
/**添加上拉加载*/
-(void)addFootRefresh:(FootRefreshBlock)block;
//添加上拉加载
-(void)addFootTextColor:(UIColor *)textColor Refresh:(FootRefreshBlock)block;
/**进入刷新状态*/
-(void)beginRefreshing;
/**结束刷新*/
-(void)endRefreshing;
/**是否隐藏底部加载更多*/
@property (nonatomic,assign)BOOL isNoMoreData;


@end

NS_ASSUME_NONNULL_END
